// ---------- 游戏主循环 ----------
void gameLoop() {
    // 1. 初始化
    system("cls");
    readMaxScore();
    drawMap();
    initSnake();
    createFood();

    // 2. 游戏运行循环
    while (!gameover) {
        drawSnake();
        showInfo();
        handleInput();
        moveSnake();
        gameover = checkCollision();
        Sleep(getSpeed());
    }

    // 3. 结束处理
    if (score > max_score) saveMaxScore();
    showGameOver(); // 显示结束界面
}

// ---------- 游戏结束界面 ----------
void showGameOver() {
    system("cls");
    setColor(12);
    cout << "\n\n  ╔══════════════════════════════════════════════╗\n";
    cout << "  ║                游 戏 结 束                   ║\n";
    // ...显示得分和选项...
}